<!DOCTYPE html>

<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE-7">
    <title>班级管理系统</title>
    <link href="../css/login.css" rel="stylesheet" type="text/css">
</head>

<body>
    <div id="header">
        <div class="logo">
            <img src="../images/logo.jpg" alt="中山大学班级管理系统">
        </div>
        <div class="title">
            <img src="../images/title.png" alt="回到主页" border="0">
        </div>
        <div class="themepic">
            <img src="../images/classroom.jpg" border="0">
        </div>
    </div>
    <!-- header end -->
    <div id="main">
        <div class="XiangKuang">
            <img src="../images/XiangKuang.png" border="0">
        </div>
        <div class="loginbox">
            <div class="loginInfo">
                <form action="" method="post">
                    <div id="idInputLine">
                        <label class="accAndPass">账号:</label>
                        <input class="loginFormIpt" style="font-size:25px" title="请输入账号" type="text" size="5" name="" id="name" value="201608240809">
                    </div>
                    <div id="passInputLine">
                        <label class="accAndPass">密码:</label>
                        <input class="loginFormIpt" style="font-size:35px" title="请输入密码" type="password" size="10" name="" id="pass" value="kq123456">
                    </div>
                    <div id="loginButton">
                        <button type="button" id="loginBtn" class="btn" onclick="login()" type="submit">登&nbsp;&nbsp;录</button>
                        <button type="button" id="loginBtn" class="btn" onclick="" type="submit">找&nbsp;回&nbsp;密&nbsp;码</button>
                    </div>
                </form>
            </div>
        </div>

    </div>
    <!-- main end -->
    <div id="footer">
        <div class="bottomlogo">
            <img src="../images/logo-bottom.jpg">
        </div>
        <div class="bottominfo">
            版权所有：中山大学The Way团队
            </br>
            Copyright © 2014-2015 Sun Yat-sen University The Way Team
        </div>
    </div>
</body>
<script src="https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
<script>
    function login() {
        // 点击登陆会执行这里的方法
        // 获取用户的输入并保存到变量里面
        var name = $("#name").val();

        var pass = $("#pass").val();

        console.log(name, pass)

        // 写了个拼音方便区分
        // {} 构建了一个 对象
        $.get("http://127.0.0.1/login", {
            sno: name,
            pass: pass
        }, function(resp) {
            // console.log(resp);
            alert(resp.msg)
            if (resp.msg == "登陆成功") {
                console.log("success")
                    // window.open("https://file:///E:/GoPath/src/pro_class_member_1116/views/Class_main/Class_main.html", "_self");
                window.open("index.html", "_self");
                // window.open("http://127.0.0.1:80/list", "_self");
            }
        })
    }
</script>

</html>